package com.example.smartcommunity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RadioButton;

import com.example.smartcommunity.com.com.lxf.feagment.BiaoyangFragment;
import com.example.smartcommunity.com.com.lxf.feagment.TousuFragment;

public class TsbyActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_tousybiaooyang);

        ImageView iv_back=findViewById(R.id.back2);
        RadioButton btn_tousu=findViewById(R.id.btn_tousu);
        RadioButton btn_biaoyang=findViewById(R.id.btn_biaoyang);
        ImageButton imagebutton=findViewById(R.id.imagebutton);
        ImageButton imagebutto=findViewById(R.id.imagebutto);

        final FrameLayout f2 =findViewById(R.id.f2);
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(TsbyActivity.this,ZhgjActivity.class);
                startActivity(intent);
            }
        });
        btn_tousu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                f2.removeAllViews();
                FragmentTransaction transaction= getSupportFragmentManager().beginTransaction();
                transaction.replace(R.id.f2 , new TousuFragment());
                transaction.commit();
            }
        });
        btn_biaoyang.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                f2.removeAllViews();
                FragmentTransaction transaction= getSupportFragmentManager().beginTransaction();
                transaction.replace(R.id.f2 , new BiaoyangFragment());
                transaction.commit();
            }
        });

        imagebutton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Intent intent = new Intent(getApplicationContext() , XztpActivity.class);
                startActivity(intent);
            }
        });
        imagebutto.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Intent intent = new Intent(getApplicationContext() , XzspActivity.class);
                startActivity(intent);
            }
        });

    }
}
